package org.simp.session;

import org.apache.mina.core.session.IoSession;
import org.simp.core.message.SimpMessage;
import org.simp.core.message.SimpMessageWraper;

/**
 * @author zhuhaitao at 2014-5-22
 *
 * SIMP session
 */
public interface SimpSession {

	/**
	 * 写消息
	 * @param message
	 * @author zhuhaitao at 2014-5-23
	 */
	public void write(SimpMessage message);
	/**
	 * 设置session名字
	 * @param sessionName
	 * @author zhuhaitao at 2014-5-23
	 */
	public void setSessionName(String sessionName);
	/**
	 * 设置当前session的类型
	 * @param nodeType
	 * @author zhuhaitao at 2014-5-28
	 */
	public void setSessionType(String nodeType);
	
	/**
	 * 关闭session
	 * 
	 * @author zhuhaitao at 2014-5-23
	 */
	public void close();
	
	
	public void refresh();
	
	public long getSessionId();
	
	public String getSessionName();
	
	public String getSessionType();
	
	public long getPacketCount();
	
	public IoSession getIoSession();
	
	public void addAttribute(String key,Object value);
	
	public Object getAttribute(String key);
}
